﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QLNS_Public;
using System.Data;
namespace QLNS_Data
{
   public class BacLuong_Data
    {
       KetNoiCSDL_Data kn = new KetNoiCSDL_Data();

       public DataTable LayDuLieu()
       {
           return kn.taobang("Load_tbl_BacLuong");
       }
       public int update_BacLuong(BacLuong_Public maBacLuong,BacLuong_Public heSo,BacLuong_Public luongCoBan)
       {
           int n = 3;
           string[]name=new string[n];
           object[] value = new object[n];
           name[0] = "@MaBacLuong";
           value[0] = maBacLuong.MaBacLuong;
           name[1] = "@HeSo";
           value[1] = heSo.HeSo;
           name[2] = "@LuongCoBan";
           value[2] = luongCoBan.LuongCoBan;
           return kn.update("Update_BacLuong",name,value,n);
       }
       public int insert_BacLuong(BacLuong_Public heSo,BacLuong_Public luongcb)
       {
           int n = 2;
           string[] name = new string[n];
           object[] value = new object[n];
           name[0] = "@HeSo";
           value[0] = heSo.HeSo;
           name[1] = "@LuongCoBan";
           value[1] = luongcb.LuongCoBan;
           return kn.update("Insert_BacLuong", name, value, n);
       }
       public int delete_BacLuong(BacLuong_Public maBacLuong)
       {
           int n = 1;
           string[] name = new string[n];
           object[] value = new object[n];
           name[0] = "@MaBacLuong";
           value[0] = maBacLuong.MaBacLuong;
           return kn.update("Delete_BacLuong", name, value, n);
       }
    }
}
